package com.heima.aliyun.green.config;

import com.heima.aliyun.green.AliyunGreenTemplate;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;

/***
 * AliyunProperties.class 交给IOC容器管理
 */
@EnableConfigurationProperties(AliyunProperties.class)
public class AliyunAutoConfiguration {

    /***
     * 将TextGreenScan注入到IOC容器
     */
    @Bean
    public TextGreenScan textGreenScan(){
        return new TextGreenScan();
    }

    @Bean
    public ImageGreenScan imageGreenScan(){
        return new ImageGreenScan();
    }

    @Bean
    public AliyunGreenTemplate aliyunGreenTemplate(TextGreenScan textGreenScan,ImageGreenScan imageGreenScan){
        return new AliyunGreenTemplate(imageGreenScan,textGreenScan);
    }
}